import Vue from 'vue'
import Element from 'element-ui'
import App from '@/App'
import i18n from '@/i18n'
import router from '@/router'
import store from '@/store'
import '@/icons'
import '@/element-ui/theme/index.css'
import '@/assets/scss/aui.scss'
import http from '@/utils/request'
import renRadioGroup from '@/components/ren-radio-group'
import renSelect from '@/components/ren-select'
import renProcessMultiple from '@/components/ren-process-multiple'
import renProcessStart from '@/components/ren-process-start'
import renProcessRunning from '@/components/ren-process-running'
import renProcessDetail from '@/components/ren-process-detail'
import renDeptTree from '@/components/ren-dept-tree'
import renRegionTree from '@/components/ren-region-tree'
import { hasPermission, getDictLabel } from '@/utils'
import cloneDeep from 'lodash/cloneDeep'
import base from './base' // 引用
import $ from 'jquery'

import {post,get,patch,put} from '@/utils/request'
// 引入echarts
import echarts from 'echarts'
Vue.prototype.$echarts = echarts
//定义全局变量
Vue.prototype.$post=post;
Vue.prototype.$get=get;
Vue.prototype.$patch=patch;
Vue.prototype.$put=put;

Vue.prototype.base = base;
Vue.prototype.$ = $;
// Vue.prototype.imgUrl = 'http://27.128.242.102:8000/'
Vue.prototype.imgUrl = 'http://192.168.3.251:8000/'
// Vue.prototype.imgUrl = 'http://192.168.0.107:8888/'

Vue.config.productionTip = false;

Vue.use(Element, {
  size: 'default',
  i18n: (key, value) => i18n.t(key, value)
});
Vue.use(base)// 将全局函数当做插件来进行注册

Vue.use(renRadioGroup);
Vue.use(renSelect);
Vue.use(renDeptTree);
Vue.use(renRegionTree);
Vue.use(renProcessMultiple);
Vue.use(renProcessStart);
Vue.use(renProcessRunning);
Vue.use(renProcessDetail);

// 挂载全局
Vue.prototype.$http = http;
Vue.prototype.$hasPermission = hasPermission;
Vue.prototype.$getDictLabel = getDictLabel;

// 保存整站vuex本地储存初始状态
window.SITE_CONFIG['storeState'] = cloneDeep(store.state);

new Vue({
  i18n,
  router,
  store,
  render: h => h(App)
}).$mount('#app');
